package com.blb.zycommunity.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.blb.zycommunity.entity.SysArea;
import com.blb.zycommunity.entity.ZyCommunity;
import com.blb.zycommunity.mapper.SysAreaMapper;
import com.blb.zycommunity.mapper.ZyCommunityMapper;
import com.blb.zycommunity.service.IZyCommunityService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 小区  服务实现类
 * </p>
 *
 * @author chenheng
 * @since 2023-11-20
 */
@Service
public class ZyCommunityServiceImpl extends ServiceImpl<ZyCommunityMapper, ZyCommunity> implements IZyCommunityService {

    @Resource
    private ZyCommunityMapper zyCommunityMapper;

    @Resource
    private SysAreaMapper sysAreaMapper;


    @Override
    public IPage<ZyCommunity> findCommunityPage(Page<ZyCommunity> page, String communityName, String communityCode,String communityId) {
        return zyCommunityMapper.selectCommunityPage(page,communityName,communityCode,communityId);
    }

    @Override
    public List<SysArea> findAreaByCode(String provinceCode, String cityCode, String townCode) {
        return zyCommunityMapper.selectAreaByCode(provinceCode, cityCode, townCode);
    }

    @Override
    public List<SysArea> findAll() {
        return sysAreaMapper.selectAll();
    }

    @Override
    public List<ZyCommunity> findAllCommunity() {
        return zyCommunityMapper.selectAllCommunity();
    }

    @Override
    public ZyCommunity selectCommunityById(String id) {
        return zyCommunityMapper.selectCommunityById(id);
    }


}
